//import sun.tools.tree.LengthExpression;

/*
 * Sourabh Jain; sourj@cs.umn.edu
 * main method class for the viro simulations
 */
public class VRR {

    /**
     * @param args
     */
    public static void main(String[] args) {
	for (int i = 0; i < args.length; i++){
	    System.out.println("Argv "+(i+1)+" : "+args[i]);
	}
	if (args.length < 1){
		System.out.println("Usage: java Viro input_graph_file");
		System.out.println("--------------  OR ----------------");
		System.out.println("Usage: java Viro input_graph_file -d fracDrop <seed value (double)>");
		System.out.println(" This option will allow the random dropping of <fracDrop> edges from the overall graph, and record the routing tables in a .rt.frac file.");
		System.exit(0);			
	}
	String input_topo = args[0];
	double seed = 1.0;
	float fracDrop = 0.0f;
		input_topo = args[0];
		System.out.println("Assumes that input is the graph file.");
	if (args.length > 2){
		fracDrop = Float.valueOf(args[2]);
		if (fracDrop < 0.0 || fracDrop > 1.0){
			System.out.println("Frac value can't be negative!");
			System.exit(0);
		}
		seed = Double.valueOf(args[3]);
	}
	World myworld = new World(input_topo, fracDrop,seed);
	
	/*
	 * FORMAT FOR THE TOPOLOGY FILE
	 * FIRST LINE WILL CONTAIN "nodes = 100" ; (if there are 100 nodes);
	 * it will be followed by edge information in each line in the following format
	 * "uid1, uid2, weight" (weight will be one for our files)
	 * 
	 * FORMAT FOR THE VID MAPPING
	 * UID,VID
	 */
	myworld.run();

    }
}
